<script lang="ts" setup>
import { ref } from 'vue';
import OrderList from './components/order-list.vue';
import CustomTab from './components/custom-tab.vue';
// 标签页数据
const orderTabs = ref([
  { label: '问医生', rendered: true },
  { label: '极速问诊', rendered: false },
  { label: '开药问诊', rendered: false },
])
// 标签索引值
const tabIndex = ref(0)
const changeTabIndex = (index:number)=>{
  tabIndex.value = index
  orderTabs.value[index].rendered = true
}
</script>

<template>
  <view class="consult-page">
    <view class="consult-status-tabs">
      <custom-tab :data="orderTabs" @change="changeTabIndex"></custom-tab>
    </view>

    <!-- 订单列表 -->
    <view v-for="(item,i) in orderTabs" :key="i" v-show="tabIndex === i">
      <order-list v-if="item.rendered" :type="i+1" />
    </view>
  </view>
</template>


<style scoped></style>